package cn.gok.oop;

class A{
    private int x;
    public A(){
        this.x=100;
    }
    public A(int x){
        this.x=x;
    }
    public void test(){
        int y=0;
        y++;
        System.out.println("x="+this.x+",y+"+y);
    }
}


class Car{
    int price;
    String name;

    public Car(int price, String name) {
        this.price = price;
        this.name = name;
    }



    @Override
    public String toString() {
        return "Car{" +
                "price=" + price +
                ", name='" + name + '\'' +
                '}';
    }
}



public class 构造函数 {
    public static void main(String[] args) {
        A a;
        a=new A();
        a.test();
    }
}
